/*
* Copyright 2008 the original author or authors.
* 
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* 
* http://www.apache.org/licenses/LICENSE-2.0
* 
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ 

package com.vtls.oai.service.providers;

import com.vtls.oai.domain.MetadataFormat;
import com.vtls.oai.domain.Record;
import com.vtls.oai.domain.SetMembership;
import com.vtls.oai.service.exceptions.CannotDisseminateFormatException;
import com.vtls.oai.service.exceptions.IdDoesNotExistException;
import com.vtls.oai.service.exceptions.NoRecordsMatchException;
import com.vtls.oai.service.exceptions.NoSetHierarchyException;
import com.vtls.oai.service.Provider;
import com.vtls.oai.service.Session;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class NullProvider implements Provider
{
   private Log log = LogFactory.getLog(getClass());	

   /* Provider Methods
   ***************************************************************************/

   public List<SetMembership> listSets() throws NoSetHierarchyException
   {
      final List<SetMembership> setMemberships = new ArrayList<SetMembership>();

      // TODO: Populate List.
      
      if(setMemberships.size() == 0)
         throw new NoSetHierarchyException();
         
      return setMemberships;
   }

   public String[] getMetadataPrefixes(final String identifier) throws IdDoesNotExistException
   {
      String[] matchingPrefixes = new String[]{};

      // TODO: Populate prefixes.
      
      return matchingPrefixes;
   }

   public Record getRecord(final String identifier, final MetadataFormat metadataFormat) throws CannotDisseminateFormatException, IdDoesNotExistException
   {
      throw new IdDoesNotExistException();
   }
   
   public List<Record> listRecords(final Session session) throws CannotDisseminateFormatException, NoRecordsMatchException
   {
      throw new NoRecordsMatchException();
   }
   
   public byte[] getRecordMetadata(final String identifier, final MetadataFormat metadataFormat) throws IOException, IdDoesNotExistException, CannotDisseminateFormatException
   {
      return null;
   }
}
